import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const routes = [
  {
    path: '/',
    meta: {isAuth: true},
    component: resolve => require(['page/index'], resolve),
    children: [
      // 订单管理
      {
        path: 'orderMange',
        meta: {isAuth: true},
        component: resolve => require(['page/orderMange'], resolve),
        children: [
          // 常规订单列表
          {
            path: 'cOrder',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/commonOrder'], resolve)
          },
          // 普通订单详情页
          {
            path: 'cODetail/:orderid',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/cOrderDetail'], resolve)
          },
          // 拼单订单列表
          {
            path: 'fight',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/fightOrder'], resolve)
          },
          // 拼单订单--主订单详情
          {
            path: 'fMODetali/:ruleid',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/fMainOrderDetail'], resolve)
          },
          // 退款订单列表
          {
            path: 'refund',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/refundOrder'], resolve)
          },
          // 发货订单列表
          {
            path: 'delivery',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/deliveryGoods'], resolve)
          },
          // 打印订单
          {
            path: 'print/:orderid',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/printOrder'], resolve)
          },
          // 供应链金融订单列表
          {
            path: 'fOrder',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/financeOrder'], resolve)
          },
          // 订单录入
          {
            path: 'add',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/addOrder'], resolve)
          },
          // E店宝订单录入
          {
            path: 'eadd',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/addOrderEStore'], resolve)
          },
          // E店宝订单查看
          {
            path: 'estore',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/entryOrderEStore'], resolve)
          },
          // 供应链订单录入
          {
            path: 'chain',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/chainOrder'], resolve)
          },
          // 录入的订单列表
          {
            path: 'eOrder',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/entryOrder'], resolve)
          },
          // 交易统计
          {
            path: 'statistics',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/echartStatistics'], resolve)
          },
          // 用户统计
          {
            path: 'member',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/echartUserStatistics'], resolve)
          },
          //  出库
          {
            path: 'appear',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/appearLibrary'], resolve)
          },
          // 入库
          {
            path: 'enter',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/enterLibrary'], resolve)
          },
          // E店宝同步
          {
            path: 'synchronized',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/eSynchronizedIndent'], resolve)
          },
          // E店宝同步详情
          {
            path: 'synchronizeddetails/:orderid',
            meta: {isAuth: true},
            component: resolve => require(['page/orderMange/eSynchronizedIndentDetails'], resolve)
          }
        ]
      },
      // 结算管理
      {
        path: 'balanceMange',
        meta: {isAuth: true},
        component: resolve => require(['page/balanceMange/index'], resolve),
        children: [
          // 等待结算
          {
            path: 'wait',
            meta: {isAuth: true},
            component: resolve => require(['page/balanceMange/accountListWait'], resolve)
          },
          // 已结算
          {
            path: 'already',
            meta: {isAuth: true},
            component: resolve => require(['page/balanceMange/accountListAlready'], resolve)
          },
          // 结算失败
          {
            path: 'fail',
            meta: {isAuth: true},
            component: resolve => require(['page/balanceMange/accountListFail'], resolve)
          },
          // 结算详情
          {
            path: 'detail/:orderid',
            meta: {isAuth: true},
            component: resolve => require(['page/balanceMange/balanceInfo'], resolve)
          }
        ]
      },
      // 商品管理
      {
        path: 'goodsMange',
        meta: {isAuth: true},
        component: resolve => require(['page/goodsMange/index'], resolve),
        children: [
          // 商品列表
          {
            path: 'list',
            meta: {isAuth: true},
            component: resolve => require(['page/goodsMange/goodsList'], resolve)
          },
          // 商品分类列表
          {
            path: 'classify',
            meta: {isAuth: true},
            component: resolve => require(['page/goodsMange/goodsClassify'], resolve)
          },
          // 商品新增--分类选择
          {
            path: 'add',
            meta: {isAuth: true},
            component: resolve => require(['page/goodsMange/add'], resolve)
          },
          // 商品新增--详情
          {
            path: 'addInfo',
            meta: {isAuth: true},
            component: resolve => require(['page/goodsMange/shopInfo'], resolve)
          },
          // 发起拼单 
          {
            path: 'launch',
            meta: {isAuth: true},
            component: resolve => require(['page/goodsMange/launchGoods'], resolve)
          },
          // 拼单列表 
          {
            path: 'launchlist',
            meta: {isAuth: true},
            component: resolve => require(['page/goodsMange/launchList'], resolve)
          },
          // 拼单列表-- 详情
          {
            path: 'detail',
            meta: {isAuth: true},
            component: resolve => require(['page/goodsMange/launchDetail'], resolve)
          }
        ]
      },
      // 分类管理
      {
        path: 'classifyMange',
        meta: {isAuth: true},
        component: resolve => require(['page/classifyMange/index'], resolve),
        children: [
          // 通用分类 
          {
            path: 'list',
            meta: {isAuth: true},
            component: resolve => require(['page/classifyMange/commonClassify'], resolve)
          },
          // 展示分类 
          {
            path: 'show',
            meta: {isAuth: true},
            component: resolve => require(['page/classifyMange/showClassify'], resolve)
          },
          // 类型管理
          {
            path: 'type',
            meta: {isAuth: true},
            component: resolve => require(['page/classifyMange/typeClassify'], resolve)
          },
          // 类型管理---新增类型
          {
            path: 'addtype',
            meta: {isAuth: true},
            component: resolve => require(['page/classifyMange/addTypeClassify'], resolve)
          },
          // 商品规格
          {
            path: 'specifications',
            meta: {isAuth: true},
            component: resolve => require(['page/classifyMange/specifications'], resolve)
          },
          // 商品规格--新增商品规格
          {
            path: 'addspecifications',
            meta: {isAuth: true},
            component: resolve => require(['page/classifyMange/addSpecifications'], resolve)
          }
        ]
      },
      // 店铺管理 
      {
        path: 'shopMange',
        meta: {isAuth: true},
        component: resolve => require(['page/shopMange/index'], resolve),
        children: [
          // 店铺列表
          {
            path: 'list',
            meta: {isAuth: true},
            component: resolve => require(['page/shopMange/shopList'], resolve)
          },
          // 店铺档案信息
          {
            path: 'shopinfo',
            meta: {isAuth: true},
            component: resolve => require(['page/shopMange/shopInfo'], resolve)
          },
          // 店铺经营状况
          {
            path: 'state',
            meta: {isAuth: true},
            component: resolve => require(['page/shopMange/shopState'], resolve)
          }
        ]
      },
      // 会员管理
      {
        path: 'memberMange',
        meta: {isAuth: true},
        component: resolve => require(['page/memberMange/index'], resolve),
        children: [
          // 会员列表
          {
            path: 'list',
            meta: {isAuth: true},
            component: resolve => require(['page/memberMange/membersList'], resolve)
          }
        ]
      },
      // 员工管理
      {
        path: 'employeeMange',
        meta: {isAuth: true},
        component: resolve => require(['page/employeeMange/index'], resolve),
        children: [
          // 员工列表
          {
            path: 'list',
            meta: {isAuth: true},
            component: resolve => require(['page/employeeMange/employeeList'], resolve)
          },
          // 新增员工
          {
            path: 'add',
            meta: {isAuth: true},
            component: resolve => require(['page/employeeMange/employeeAdd'], resolve)
          },
          // 员工申请审批
          {
            path: 'apply',
            meta: {isAuth: true},
            component: resolve => require(['page/employeeMange/employeeApply'], resolve)
          },
          // 员工详情
          {
            path: 'detail',
            meta: {isAuth: true},
            component: resolve => require(['page/employeeMange/employeeDetail'], resolve)
          },
          // 修改密码
          {
            path: 'modify',
            meta: {isAuth: true},
            component: resolve => require(['page/employeeMange/modifyPwd'], resolve)
          },
          // 申请回复查看
          {
            path: 'result',
            meta: {isAuth: true},
            component: resolve => require(['page/employeeMange/employApplyResult'], resolve)
          }
        ]
      },
      // 角色管理
      {
        path: 'roleMange',
        meta: {isAuth: true},
        component: resolve => require(['page/roleMange/index'], resolve),
        children: [
          // 角色列表
          {
            path: 'list',
            meta: {isAuth: true},
            component: resolve => require(['page/roleMange/roleList'], resolve)
          },
          // 新增角色 
          {
            path: 'add',
            meta: {isAuth: true},
            component: resolve => require(['page/roleMange/roleAdd'], resolve)
          }
        ]
      },
      // 菜单管理
      {
        path: 'menuMange',
        meta: {isAuth: true},
        component: resolve => require(['page/menuMange/index'], resolve),
        children: [
          // 菜单列表
          {
            path: 'list',
            meta: {isAuth: true},
            component: resolve => require(['page/menuMange/menuList'], resolve)
          }
        ]
      },
      // 部门管理
      {
        path: 'departmentMange',
        meta: {isAuth: true},
        component: resolve => require(['page/departmentMange/index'], resolve),
        children: [
          // 部门列表
          {
            path: 'list',
            meta: {isAuth: true},
            component: resolve => require(['page/departmentMange/departmentList'], resolve)
          }
        ]
      },
      // 日志管理
      {
        path: 'logMange',
        meta: {isAuth: true},
        component: resolve => require(['page/logMange/index'], resolve),
        children: [
          // 日志列表
          {
            path: 'list',
            meta: {isAuth: true},
            component: resolve => require(['page/logMange/logList'], resolve)
          }
        ]
      },
      // 字典管理
      {
        path: 'dictionaryMange',
        meta: {isAuth: true},
        component: resolve => require(['page/dictionaryMange/index'], resolve),
        children: [
          // 字典列表
          {
            path: 'list',
            meta: {isAuth: true},
            component: resolve => require(['page/dictionaryMange/dictionaryList'], resolve)
          }
        ]
      },
      // 银行卡管理
      {
        path: 'bankCardMange',
        meta: {isAuth: true},
        component: resolve => require(['page/bankCardMange/index'], resolve),
        children: [
          // 银行卡列表
          {
            path: 'list',
            meta: {isAuth: true},
            component: resolve => require(['page/bankCardMange/bankCardList'], resolve)
          }
        ]
      },
      // app版本管理
      {
        path: 'versionMange',
        meta: {isAuth: true},
        component: resolve => require(['page/versionMange/index'], resolve),
        children: [
          // app版本
          {
            path: 'version',
            meta: {isAuth: true},
            component: resolve => require(['page/versionMange/appVersion'], resolve)
          }
        ]
      },
      // 运费模板管理
      {
        path: 'freightMange',
        meta: {isAuth: true},
        component: resolve => require(['page/freightMange/index'], resolve),
        children: [
          // 运费模板列表
          {
            path: 'list',
            meta: {isAuth: true},
            component: resolve => require(['page/freightMange/freightList'], resolve)
          },
          // 运费模板详情
          {
            path: 'info',
            meta: {isAuth: true},
            component: resolve => require(['page/freightMange/freightInfo'], resolve)
          }
        ]
      },
      // 常规设置
      {
        path: 'normalSet',
        meta: {isAuth: true},
        component: resolve => require(['page/normalSet/index'], resolve),
        children: [
          // 基本信息
          {
            path: 'base',
            meta: {isAuth: true},
            component: resolve => require(['page/normalSet/baseInfo'], resolve)
          }
        ]
      },
      // 广告管理
      {
        path: 'advertMange',
        meta: {isAuth: true},
        component: resolve => require(['page/advertMange/index'], resolve),
        children: [
          // 广告位列表
          {
            path: 'position',
            meta: {isAuth: true},
            component: resolve => require(['page/advertMange/advertPositionList'], resolve)
          },
          // 广告位新增
          {
            path: 'addPos',
            meta: {isAuth: true},
            component: resolve => require(['page/advertMange/advertPositionAdd'], resolve)
          },
          // 广告列表
          {
            path: 'list',
            meta: {isAuth: true},
            component: resolve => require(['page/advertMange/advertList'], resolve)
          },
          // 广告新增
          {
            path: 'add',
            meta: {isAuth: true},
            component: resolve => require(['page/advertMange/advertAdd'], resolve)
          },
          // 广告待审核列表
          {
            path: 'apply',
            meta: {isAuth: true},
            component: resolve => require(['page/advertMange/advertApplyList'], resolve)
          }
        ]
      },
      // 频道管理
      {
        path: 'channelMange',
        meta: {isAuth: true},
        component: resolve => require(['page/channelMange/index'], resolve),
        children: [
          // 频道列表
          {
            path: 'list',
            meta: {isAuth: true},
            component: resolve => require(['page/channelMange/channelList'], resolve)
          },
          // 频道新增
          {
            path: 'add',
            meta: {isAuth: true},
            component: resolve => require(['page/channelMange/channelAdd'], resolve)
          }
        ]
      },
      // 楼层管理
      {
        path: 'floorMange',
        meta: {isAuth: true},
        component: resolve => require(['page/floorMange/index'], resolve),
        children: [
          // 首页楼层列表
          {
            path: 'list',
            meta: {isAuth: true},
            component: resolve => require(['page/floorMange/floorList'], resolve)
          },
          // 首页楼层新增
          {
            path: 'add',
            meta: {isAuth: true},
            component: resolve => require(['page/floorMange/floorAdd'], resolve)
          },
          // 频道楼层列表
          {
            path: 'cList',
            meta: {isAuth: true},
            component: resolve => require(['page/floorMange/channelFloorList'], resolve)
          },
          // 频道楼层新增
          {
            path: 'cAdd',
            meta: {isAuth: true},
            component: resolve => require(['page/floorMange/channelFloorAdd'], resolve)
          }
        ]
      },
      // 首页装修
      {
        path: 'homeDecorate',
        meta: {isAuth: true},
        component: resolve => require(['page/homeDecorate/index'], resolve),
        children: [
          // pc装修
          {
            path: 'pc',
            meta: {isAuth: true},
            component: resolve => require(['page/homeDecorate/pcDecorate'], resolve)
          },
          // pc编辑
          {
            path: 'edit',
            meta: {isAuth: true},
            component: resolve => require(['page/homeDecorate/editTemplate'], resolve)
          },
          // app装修
          {
            path: 'app',
            meta: {isAuth: true},
            component: resolve => require(['page/homeDecorate/appDecorate'], resolve)
          },
          // app编辑
          {
            path: 'appEdit',
            meta: {isAuth: true},
            component: resolve => require(['page/homeDecorate/editApp'], resolve)
          }
        ]
      },
      // 热点头条模板管理
      {
        path: 'hotNewMange',
        meta: {isAuth: true},
        component: resolve => require(['page/hotNewMange/index'], resolve),
        children: [
          // 热点头条列表
          {
            path: 'list',
            meta: {isAuth: true},
            component: resolve => require(['page/hotNewMange/hotNew'], resolve)
          },
          // 热点头条新增/修改
          {
            path: 'add',
            meta: {isAuth: true},
            component: resolve => require(['page/hotNewMange/add'], resolve)
          }
        ]
      },
      // 导航管理
      {
        path: 'navigationMange',
        meta: {isAuth: true},
        component: resolve => require(['page/navigationMange/index'], resolve),
        children: [
          // 导航列表
          {
            path: 'list',
            meta: {isAuth: true},
            component: resolve => require(['page/navigationMange/navigationList'], resolve)
          }
        ]
      },
      // 视频管理
      {
        path: 'videoMange',
        meta: {isAuth: true},
        component: resolve => require(['page/videoMange/index'], resolve),
        children: [
          // 视频列表
          {
            path: 'list',
            meta: {isAuth: true},
            component: resolve => require(['page/videoMange/videoList'], resolve)
          },
          // 视频 新增
          {
            path: 'add',
            meta: {isAuth: true},
            component: resolve => require(['page/videoMange/videoAdd'], resolve)
          }
        ]
      }
    ]
  },
  // 登录
  {
    path: '/login',
    component: resolve => require(['page/login'], resolve)
  },
  // 找回密码
  {
    path: '/findpassword',
    component: resolve => require(['page/findpassword'], resolve)
  }
]

export default new Router({
  mode: 'history',
  routes
})
